package com.itheima.spring.bestpractive.common.exception;

import lombok.Getter;

/**
 * @version 1.0
 * @author: HZY
 * @date: 2025/6/24 23:25
 * @Content:
 */
@Getter
public enum BizEnum {
    // ========== 用户相关 ==========
    USER_LOST_ID(2001, "用户尚未注册"),
    USER_NOT_EXIST(2002, "用户名或密码错误"),
    USER_ALREADY_EXIST(2003, "用户已存在"),
    USER_PERMISSION_DENIED(2004, "用户无权限"),

    // ========== 登录认证 ==========
    USER_LOST_TOKEN(3001, "用户尚未登录"),
    LOGIN_FAILED(3002, "登录失败"),
    TOKEN_EXPIRED(3003, "Token已过期"),
    TOKEN_INVALID(3004, "Token无效"),
    TOKEN_MISSING(3005, "Token缺失"),

    // ========== 操作限制 ==========
    OPERATION_NOT_ALLOWED(4001, "当前操作不允许"),
    DATA_CONFLICT(4002, "数据冲突"),
    DATA_NOT_FOUND(4003, "数据未找到");


    private final int code;
    private final String message;

    private BizEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
